
const {createServer} = require('http')
const express = require('express')
const app = express()
const {Server} = require('socket.io')
const httpServer = createServer(app)
const io = new Server(httpServer,{
    cors:{
        origin:'http://localhost:5173',
        methods:['GET','POST']
    }
})

io.on('connection',(socket)=>{
    console.log(socket.handshake.query.username);
    
})

app.listen(8000,()=>{
    console.log('server is running on port 8000')
})